package j2024.j202411;

import java.util.*;

public class j1103 {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        double ret = 1.0;
        for (int i = n; i >= n-m+1; i--) {
            ret*=n;
        }
        for (int i = m; i >= 2; i--) {
            ret/=i;
        }
        for (int i = 0; i < m; i++) {
            ret*=0.8;
        }
        for (int i = 0; i < n-m+1; i++) {
            ret*=0.2;
        }
        System.out.printf("%.4f",ret);
    }
    public static int n,l,r;
    public static int[] arr;
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        l = in.nextInt();
        r = in.nextInt();
        arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        System.out.println(find(r)-find(l));
    }
    public static long find(int x){
         int left = 0,right = 0;
         long ret = 0;
         while(right<n){
             while(arr[right]-arr[left]>x){
                 left++;
             }
             ret+=right-left;
             right++;
         }
         return ret;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int nn = in.nextInt();
        int x = 1,y = 2;
        for (int i = 2; i <= nn; i++) {
            int xx = x,yy = y;
            x = (2*yy+1)%1000000007;
            y = (2*yy+2+x)%1000000007;
        }
        System.out.println(x+" "+y);
    }

    /**
     * 102. 二叉树的层序遍历
     * @param root
     * @return
     */
    public List<List<Integer>> levelOrder(TreeNode root) {
        List<List<Integer>> ret = new ArrayList<>();
        if(root == null){
            return ret;
        }
        Queue<TreeNode> queue = new LinkedList<>();
        queue.offer(root);
        while(!queue.isEmpty()){
            int size = queue.size();
            List<Integer> list = new ArrayList<>();
            while(size > 0){
                TreeNode cur = queue.poll();
                list.add(cur.val);
                if(cur.left!=null){
                    queue.offer(cur.left);
                }
                if(cur.right!=null){
                    queue.offer(cur.right);
                }
                size--;
            }
            ret.add(list);
        }
        return ret;
    }
}
